<template>
  <a-modal
    :title="title"
    :visible="visible"
    :mask-closable="false"
    :body-style="{paddingBottom: '8px'}"
    :confirm-loading="submitLoading"
    @ok="handleSubmit"
    @cancel="handleClose"
  >
    <a-form
      :form="form"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
    >
      <a-form-item v-if="isUpdateForm" style="display: none">
        <a-input v-decorator="['id']" />
      </a-form-item>
      <a-form-item label="工序ID">
        <a-input v-decorator="['processId']" placeholder="工序ID" />
      </a-form-item>
      <a-form-item label="开始时间">
        <a-input v-decorator="['startTime']" placeholder="开始时间" />
      </a-form-item>
      <a-form-item label="结束时间">
        <a-input v-decorator="['endTime']" placeholder="结束时间" />
      </a-form-item>
      <a-form-item label="完工数量">
        <a-input v-decorator="['completedQuantity']" placeholder="完工数量" />
      </a-form-item>
      <a-form-item label="报废数量">
        <a-input v-decorator="['scrappedQuantity']" placeholder="报废数量" />
      </a-form-item>
      <a-form-item label="备注">
        <a-input v-decorator="['remark']" placeholder="备注" />
      </a-form-item>
      <a-form-item label="报工工号">
        <a-input v-decorator="['reportEmployeeId']" placeholder="报工工号" />
      </a-form-item>
      <a-form-item label="机台编号">
        <a-input v-decorator="['machineNumber']" placeholder="机台编号" />
      </a-form-item>
      <a-form-item label="最早开始时间">
        <a-input v-decorator="['earliestStartTime']" placeholder="最早开始时间" />
      </a-form-item>
      <a-form-item label="总实际工时(分钟)">
        <a-input v-decorator="['totalActualHours']" placeholder="总实际工时(分钟)" />
      </a-form-item>
      <a-form-item label="包含准备工时">
        <a-input v-decorator="['includesSetupTime']" placeholder="包含准备工时" />
      </a-form-item>
      <a-form-item label="报工电脑">
        <a-input v-decorator="['reportComputer']" placeholder="报工电脑" />
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
import { PopUpFormMixin } from '@/mixins'
import { addObj, putObj } from '@/api/ProductionProcesses/t-time-segment-record'

export default {
  name: 'TTimeSegmentRecordModalForm',
  mixins: [PopUpFormMixin],
  data () {
    return {
      reqFunctions: {
        create: addObj,
        update: putObj
      },

      labelCol: {
        sm: { span: 24 },
        md: { span: 5 }
      },
      wrapperCol: {
        sm: { span: 24 },
        md: { span: 19 }
      },

      // 校验配置
      decoratorOptions: {}
    }
  },
  methods: {}
}
</script>